using Blog.Service;
using Blog.Service.User;
using Blog.Service.User.Input;
using Blog.Service.User.Output;
using Microsoft.AspNetCore.Mvc;
using XjjXmm.Infrastructure.Repository;
using XjjXmm.Infrastructure.Repository.Model;

namespace Blog.API.Controllers;



/// <summary>
/// 用户
///</summary>
[ApiController]
[Route("api/admin/[controller]/[action]")]
public class UserController  : CrudController<UserModel>
{
    private readonly IUserService _userService;

    public UserController(IUserService userService) : base(userService)
    {
        _userService = userService;
    }

    /// <summary>
    /// 查询分页用户
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost]
    //[ResponseCache(Duration = 60)]
    public async Task<PageOutput<UserListOutput>> GetPage(PageInput<UserListInput> input)
    {
        return await _userService.Page(input);
    }
}